<?php
function fenyexianshi($page,$pagenum,$type,$ajax_function,$parameters1,$parameters2,$parameters3){
				$listname_id=$parameters1;
					
				
				
if($pagenum<7){
				$max=$pagenum;
				$star=1;$end=$pagenum;
			}else{
					if($page<=4){
					$star=1;$end=7;
					}else{
					 $star=$page-3;
					$end=$star+6;
						if($end>$pagenum){
						$end=$pagenum;
						}
					}
			}		
					if($pagenum==1){
						$show="<label class='fa'  style='float:left'  >首页</label>";
						echo '<font size="5" color="#9BA392">'.$show.'</font>'." ";
							$old="<label class='fa'  style='float:left'  ><label> << </label></label>";
							echo '<font size="10" color="#9BA392">'.$old.'</font>'." ";
								$page1="<label class='fa'  style='float:left'  ><label>".$page."</label></label>";
								echo '<font size="10" color="#9BA392">'.$page1.'</font>'." ";
							$old="<label class='fa'  style='float:left'  ><label> >> </label></label>";
							echo '<font size="10" color="#9BA392">'.$old.'</font>'." ";
						$show="<label class='fa'  style='float:left'  >尾页</label>";
						echo '<font size="10" color="#9BA392">'.$show.'</font>'." ";	
		
					}else if( $star==1 and  $page<$end){
						
						if($page==1 ){
						$show="<label class='fa'  style='float:left'  >首页</label>";
						echo '<font size="5" color="#9BA392">'.$show.'</font>'." ";
							$old="<label class='fa'  style='float:left'  ><label> << </label></label>";
							echo '<font size="10" color="#9BA392">'.$old.'</font>'." ";
						}else{
						$show="<label class='fa' style='float:left' ><a  onclick='".$ajax_function."(1,".$type.",".$pagenum.",\"".$parameters1."\",".$parameters2.",".$parameters3.")' >首页</a></label>";
						echo '<font size="5" color="#38CBFB">'.$show.'</font>'." ";
							$oldpage=$page-1;
							$old="<label class='fa'  style='float:left' ><a onclick='".$ajax_function."(1,".$type.",".$pagenum.",\"\"".$parameters1."\"\",".$parameters2.",".$parameters3.")'><label> << </label></a></label>";
							echo '<font size="10" color="#38CBFB">'.$old.'</font>'." ";
						}
						
						
						for($jj=$star;$jj<=$end;$jj++){
								$show=($jj!=$page)?"<label class='fa'  style='float:left'  ><a onclick='".$ajax_function."(".$jj.",".$type.",".$pagenum.",\"".$parameters1."\",".$parameters2.",".$parameters3.")' >$jj</a></label>":"<label class='fa'  style='float:left'  onfocus='chang()'><b>$jj</b></label>";
								echo '<font size="10" color="#38CBFB">'.$show.'</font>'." ";	
						}
						if($page==$pagenum){
						
							$next="<label class='fa'  style='float:left' ><label> >> </label></label>";
							echo '<font size="10" color="#9BA392">'.$next.'</font>'." ";
							$show="<label class='fa'  style='float:left'  >尾页</label>";
							echo '<font size="5" color="#9BA392">'.$show.'</font>'." ";
						}else{
							$nextpage=$page+1;
							$next="<label class='fa'  style='float:left'  ><a onclick='".$ajax_function."(".$nextpage.",".$type.",".$pagenum.",\"".$parameters1."\",".$parameters2.",".$parameters3.")' ><label> >> </label></a></label>";
							echo '<font size="10" color="#38CBFB">'.$next.'</font>'." ";
						
							$show="<label class='fa'  style='float:left'  ><a onclick='".$ajax_function."(".$pagenum.",".$type.",".$pagenum.",\"".$parameters1."\",".$parameters2.",".$parameters3.")' >尾页</a></label>";
								echo '<font size="5" color="#38CBFB">'.$show.'</font>'." ";
						}		
					}else{
					
						$show="<label class='fa'  style='float:left'   ><a onclick='".$ajax_function."(1,".$type.",".$pagenum.",\"".$parameters1."\",".$parameters2.",".$parameters3.")'>首页</a></label>";
						echo '<font size="5" color="#38CBFB">'.$show.'</font>'." ";
					
						$oldpage=$page-1;
						$old="<label class='fa'  style='float:left'  ><a onclick='".$ajax_function."(1,".$type.",".$pagenum.",\"".$parameters1."\",".$parameters2.",".$parameters3.")'><label> << </label></a></label>";
						echo '<font size="10" color="#38CBFB">'.$old.'</font>'." ";
						
						for($jj=$star;$jj<=$end;$jj++){
							$show=($jj!=$page)?"<label class='fa'  style='float:left'   ><a onclick='".$ajax_function."(".$jj.",".$type.",".$pagenum.",\"".$parameters1."\",".$parameters2.",".$parameters3.")'>$jj</a></label>":"<label class='fa'  style='float:left'  onfocus='chang()'><b>$jj</b></label>";
							echo '<font size="10" color="#38CBFB">'.$show.'</font>'." ";	
						}
						if($page==$pagenum){
						
							$next="<label class='fa'  style='float:left' ><label> >> </label></label>";
							echo '<font size="10" color="#9BA392">'.$next.'</font>'." ";
							$show="<label class='fa'  style='float:left'  >尾页</label>";
							echo '<font size="5" color="#9BA392">'.$show.'</font>'." ";
						}else{
							$nextpage=$page+1;
							$next="<label class='fa'  style='float:left'  ><aonclick='".$ajax_function."(".$nextpage.",".$type.",".$pagenum.",\"".$parameters1."\",".$parameters2.",".$parameters3.")'><label> >> </label></a></label>";
							echo '<font size="10" color="#38CBFB">'.$next.'</font>'." ";
							
							$show="<label class='fa'  style='float:left' ><a onclick='".$ajax_function."(".$pagenum.",".$type.",".$pagenum.",\"".$parameters1."\",".$parameters2.",".$parameters3.")'>尾页</a></label>";
							echo '<font size="5" color="#38CBFB">'.$show.'</font>'." ";
						}
						 }
						

}



?>